package com.midele.goodstuff.ui.component

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.midele.goodstuff.util.LogUtils

@Composable
fun TagItem(text: String, onClick: (str:String) -> Unit) {
    Box(
        modifier = Modifier
            .background(Color(0xFF323233), shape = RoundedCornerShape(100.dp))
            .padding(top = 4.dp, bottom = 4.dp, start = 10.dp, end = 10.dp)
            .clickable{
                onClick(text)
                LogUtils.d("SearchScreen", "点击了22$text")
            },
        contentAlignment = Alignment.Center
    ) {
        Text(
            text = text,
            style = TextStyle(
                color = Color.White,
                fontSize = 14.sp,
                fontWeight = FontWeight.Bold
            ),
            modifier = Modifier.clickable {
                onClick(text)
                LogUtils.d("SearchScreen", "点击了111$text")
            }
        )
    }
}